﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Halcon二次开发.Controller.趋势图工具
{
    public class TrendChartController : IComparable<TrendChartController>
    {
        string id;
        string result;
        string time;
        string tool;
        Image image;
        public TrendChartController(string id, string result, string time, string tool, Image image)
        {
            Id = id;
            Result = result;
            Time = time;
            Tool = tool;
            Image = image;
        }
        public string Id { get => id; set => id = value; }
        public string Result { get => result; set => result = value; }
        public string Time { get => time; set => time = value; }
        public string Tool { get => tool; set => tool = value; }
        public Image Image { get => image; set => image = value; }

        public int CompareTo(TrendChartController other)
        {
            if (other == null) return 1;

            int ageComparison =int.Parse( this.id)-(int.Parse(other.id));
            if (ageComparison >=0)
            {
                return ageComparison;
            }
            else
            {
                return int.Parse(this.id) - (int.Parse(other.id));
            }
        }
    }
}
